package com.up.cloudfeiyibackend.controller;

import com.up.cloudfeiyibackend.result.Result;
import com.up.cloudfeiyibackend.service.NewsService;
import com.up.cloudfeiyibackend.vo.NewsCategoryVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *
 *
 * 新闻资讯接口
 *
 * @author 南文朋
 */
@RestController
@RequestMapping("/news")
public class NewsController {
    @Autowired
    private NewsService newsService;

    /**
     *
     * 获取新闻分类
     * @return
     */
    @GetMapping("/category")
    public Result<List<NewsCategoryVO>> getNewsCategory() {
        return newsService.getNewsCategory();
    }
}
